<template>
  <div class="bgColor">
    <!-- 导航栏 -->
    <van-nav-bar
      title="精彩跟帖"
      left-text="返回"
      left-arrow
      @click-left="$router.back()"
    />
    <div class="comment_list">
      <CommentMain
        v-for="item in commentList"
        :key="item.id"
        :commentData="item"
      />
    </div>
  </div>
</template>

<script>
import { getPostCommentById } from "@/api";
import CommentMain from "../components/Comment/Main";
export default {
  data() {
    return {
      commentList: [],
    };
  },
  components: {
    CommentMain,
  },
  created() {
    const { id } = this.$route.params;
    getPostCommentById(id).then((res) => {
      this.commentList = res.data.data;
    });
  },
};
</script>

<style lang="less" scoped>
.bgColor {
  background-color: #f2f2f2;
}
</style>